package com.example.qxglxt.model;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
//import javax.persistence.EntityListeners;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.CreationTimestamp;
import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;
//import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import lombok.Data;

@Data
@Entity
@Table
//@EntityListeners(AuditingEntityListener.class)
public class Users {


   /*  @Id//主键
    @GeneratedValue//自动生成id
    private Integer Id;
    @Column(unique = true)
    private String LoginName;//登录名
    private String password;//密码
    @Column(length = 10,columnDefinition = "String default 否")
    private String IsLocKout;//是否锁定
    @CreationTimestamp//自动生成系统时间，格式为yyyy-MM-dd HH:mm:ss
    private String LastLoginTime;//最后一次登录时间
    @CreationTimestamp//自动生成系统时间，格式为yyyy-MM-dd HH:mm:ss
    private String CreateTime;//账户创立时间
    private Integer PsdWrongTime;//密码错误次数
    private Date LockTime;//被锁定时间
    private String ProtectEmail;//密保邮箱
    @Column(unique = true,length = 11)
    private String ProtectMtel;//密保手机号
    @ManyToOne(targetEntity = Roles.class)
    private Roles roleId;//角色id */
    @Id
    @GeneratedValue
    private Integer id;//编号id
    @Column(unique = true)
    private String LoginName;//登录名
    private String PassWord;//密码
    @Column(columnDefinition = "char(2) default '否'",insertable = false)
    private String IsLockout;//是否锁定
    @CreationTimestamp//自动生成系统时间，且格式为yyyy-MM-dd HH:mm:ss
    private Date LastLoginTime;//最后登陆时间
    @CreationTimestamp//自动生成系统时间，且格式为yyyy-MM-dd HH:mm:ss
    private Date CreateTime;//创建时间
    private Integer PsdWodrong;//密码错误次数
    private Date LockTime;//被锁定时间
    private String ProTectEmail;//密保邮箱
    @Column(unique = true,length = 11)
    private String ProtectMtel;//密保手机号
    @ManyToOne(targetEntity = UserRoles.class)
    @NotFound(action = NotFoundAction.IGNORE)//找不到外键引用时忽略
    private UserRoles roleId;//角色id  

}